package com.s3.khospitalds.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.s3.khospitalds.entity.Drugs;
import com.s3.khospitalds.mapper.DrugsMapper;
import com.s3.khospitalds.service.DrugsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: xw
 * @CreateTime: 2025/2/26
 * @Description: 药品信息表
 * @Version: 1.0
 */
@Service
public class DrugsServiceImpl extends ServiceImpl<DrugsMapper, Drugs> implements DrugsService {
    @Autowired
    DrugsMapper drugsMapper;

    @Override
    public List<Drugs> getDrugs() {
        return drugsMapper.getDrugs();
    }

    @Override
    public List<Drugs> getDrugsW() {
        return drugsMapper.getDrugsW();
    }

    @Override
    public List<Drugs> getDrugsByTypeLike(String type) {
        return drugsMapper.getDrugsByTypeLike(type);
    }

    @Override
    public int insertDrugs(Drugs drugs) {
        return drugsMapper.insertDrugs(drugs);
    }

    @Override
    public List<Drugs> getDrugsByQuantity() {
        return drugsMapper.getDrugsByQuantity();
    }

    @Override
    public List<Drugs> getDrugsByTypeLikeW(String type) {
        return drugsMapper.getDrugsByTypeLikeW(type);
    }

    @Override
    public List<Drugs> getDrugsByDrugNameLike(String drugname) {
        return drugsMapper.getDrugsByDrugNameLike(drugname);

    }

    @Override
    public int insertDrugsW(Drugs drugs) {
        System.out.println("drugs = " + drugs);
        return drugsMapper.insertDrugsW(drugs);
    }

    @Override
    public List<Drugs> getDrugsByQuantityW() {
        return drugsMapper.getDrugsByQuantityW();
    }

    @Override
    public int updateDrugsQuantity(Drugs drugs) {
        return drugsMapper.updateDrugsQuantity(drugs);
    }

    @Override
    public int updateDrugs(String drugname, int quantity) {
        return drugsMapper.updateDrugs(drugname,quantity);
    }

    @Override
    public int updateDrugsW(String drugname, int quantity) {
        return drugsMapper.updateDrugsW(drugname,quantity);
    }
}
